package com.zjw.nanyinge.config;

import com.theokanning.openai.service.OpenAiService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.time.Duration;

@Component
public class WebConfig {

    @Bean
    private OpenAiService getOpenAiService(@Value("${openAI.token}") String token) {
        return new OpenAiService(token, Duration.ofSeconds(60));
    }
}
